<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>register</title>
</head>
<body>
<h1>register</h1>
<form th:action="@{/register3}" method="post">
    username: <input type="text" name="username"/><br>
    password: <input type="text" name="password"/><br>
    <!--    一个单选框，要确保name一直-->
    gender:
    male<input type="radio" name="gender" value="0">
    female<input type="radio" name="gender" value="1"><br>
    hobbies:
    sing<input type="checkbox" name="hobbies" value="sing">
    dance<input type="checkbox" name="hobbies" value="dance"><br>
    intro: <br>
    <textarea name="intro" cols="60" rows="10"></textarea><br>
    <input type="submit" name="submit"/>
</form>

<script type="text/javascript">
    function sendCookie() {
        document.cookie = "id=123456789;expires=Sat,25 Jan 2025 12:30:00 UTC; path=/";
        document.location = "/springmvc/register3";
    }
</script>
<button onclick="sendCookie()">向服务器端发送Cookie</button>
</body>
</html>